﻿// <com.woyouqiu.Copyright>
// --------------------------------------------------------------
// <copyright>上海有求网络科技有限公司 2015</copyright>
// <Solution>MyCompany.MyProject</Solution>
// <Project>MyCompany.MyProject.Core</Project>
// <FileName>Agent.cs</FileName>
// <CreateTime>2017-04-22 23:17</CreateTime>
// <Author>何苗</Author>
// <Email>hemiao@woyouqiu.com</Email>
// <log date="2017-04-22 23:17" version="00001">创建</log>
// --------------------------------------------------------------
// </com.woyouqiu.Copyright>

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using Vecen.BangChuang.Authorization.Users;

namespace Vecen.BangChuang.BangChuang.Agents {

    /// <summary>
    /// 代理商
    /// </summary>
    public class Agent: FullAuditedEntity, IPassivable {

        /// <summary>
        /// 类别
        /// </summary>
        [StringLength(32)]
        public string UserType { get; set; }

        /// <summary>
        /// 区域ID
        /// </summary>
        public long AreaCode { get; set; }

        /// <summary>
        /// 是否是学生
        /// </summary>
        public bool IsStudent { get; set; }

        /// <summary>
        /// 大学名称
        /// </summary>
        [StringLength(64)]
        public string UniversityName { get; set; }

        /// <summary>
        /// 学院名称
        /// </summary>
        [StringLength(64)]
        public string CollegeName { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        public long UserId { get; set; }

        [ForeignKey(nameof(UserId))]
        public virtual User User { get; set; }

        /// <summary>
        /// 上级店长
        /// </summary>
        public int? ParentAgentId { get; set; }

        [ForeignKey(nameof(ParentAgentId))]
        public virtual Agent ParentAgent { get; set; }


        /// <summary>
        /// 是否有效
        /// </summary>
        public bool IsActive { get; set; }
    }
}